package printer;

/*
 * 测试类：使用打印机安装不同的墨盒和纸张进行打印
 */

public class Test {
	public static void main(String[] args) {
		Printer printer = new Printer();
		InkBox inkBox = null;
		Paper paper = null;

		// 使用黑色墨盒往A4纸上打印
		inkBox = new GrayInkBox();
		paper = new A4Paper();
		printer.setInkBox(inkBox);
		printer.setPaper(paper);
		printer.print();

		// 使用彩色墨盒往A4纸上打印
		inkBox = new ColorInkBox();
		printer.setInkBox(inkBox);
		printer.print();

		// 使用彩色墨盒往B5纸上打印
		paper = new B5Paper();
		printer.setPaper(paper);
		printer.print();

		// 使用黑色墨盒往B5纸上打印
		inkBox = new GrayInkBox();
		printer.setInkBox(inkBox);
		printer.print();
	}

}
